\(\int \sqrt {a^2+2 a b x+b^2 x^2} \, dx\) [141]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 32 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {(a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b} \]

[Out]

1/2*(b*x+a)*((b*x+a)^2)^(1/2)/b

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {623} \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {(a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b} \]

[In]

Int[Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

((a + b*x)*Sqrt[a^2 + 2*a*b*x + b^2*x^2])/(2*b)

Rule 623

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^p/(2*c*(2*p + 1)
)), x] /; FreeQ[{a, b, c, p}, x] && EqQ[b^2 - 4*a*c, 0] && NeQ[p, -2^(-1)]

Rubi steps \begin{align*} \text {integral}& = \frac {(a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.94 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {x \sqrt {(a+b x)^2} (2 a+b x)}{2 (a+b x)} \]

[In]

Integrate[Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

(x*Sqrt[(a + b*x)^2]*(2*a + b*x))/(2*(a + b*x))

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 2.

Time = 0.19 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.59

method result size
default \(\frac {\operatorname {csgn}\left (b x +a \right ) \left (b x +a \right )^{2}}{2 b}\) \(19\)
gosper \(\frac {x \left (b x +2 a \right ) \sqrt {\left (b x +a \right )^{2}}}{2 b x +2 a}\) \(27\)
risch \(\frac {\sqrt {\left (b x +a \right )^{2}}\, a x}{b x +a}+\frac {\sqrt {\left (b x +a \right )^{2}}\, b \,x^{2}}{2 b x +2 a}\) \(43\)

[In]

int(((b*x+a)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*csgn(b*x+a)*(b*x+a)^2/b

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.31 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{2} \, b x^{2} + a x \]

[In]

integrate(((b*x+a)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*b*x^2 + a*x

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (19) = 38\).

Time = 0.51 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.75 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\begin {cases} \left (\frac {a}{2 b} + \frac {x}{2}\right ) \sqrt {a^{2} + 2 a b x + b^{2} x^{2}} & \text {for}\: b^{2} \neq 0 \\\frac {\left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3 a b} & \text {for}\: a b \neq 0 \\x \sqrt {a^{2}} & \text {otherwise} \end {cases} \]

[In]

integrate(((b*x+a)**2)**(1/2),x)

[Out]

Piecewise(((a/(2*b) + x/2)*sqrt(a**2 + 2*a*b*x + b**2*x**2), Ne(b**2, 0)), ((a**2 + 2*a*b*x)**(3/2)/(3*a*b), N
e(a*b, 0)), (x*sqrt(a**2), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (19) = 38\).

Time = 0.22 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.44 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{2} \, \sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} x + \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a}{2 \, b} \]

[In]

integrate(((b*x+a)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*x + 1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*a/b

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.03 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{2} \, {\left (b x^{2} + 2 \, a x\right )} \mathrm {sgn}\left (b x + a\right ) + \frac {a^{2} \mathrm {sgn}\left (b x + a\right )}{2 \, b} \]

[In]

integrate(((b*x+a)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*(b*x^2 + 2*a*x)*sgn(b*x + a) + 1/2*a^2*sgn(b*x + a)/b

Mupad [B] (verification not implemented)

Time = 9.11 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.59 \[ \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {\sqrt {{\left (a+b\,x\right )}^2}\,\left (a+b\,x\right )}{2\,b} \]

[In]

int(((a + b*x)^2)^(1/2),x)

[Out]

(((a + b*x)^2)^(1/2)*(a + b*x))/(2*b)